package utility;

import gameObjects.Bike.POINTTO;

public class FixPosition {
	private static float wallX;
	private static float wallZ;
	
	public float fixPosX(float x, POINTTO direction)
	{
		float X = -1;
		switch(direction)
		{
		case NORTH:{X = (int)Math.floor(x);break;}
		case SOUTH:{X = (int)Math.floor(x);break;}
		case EAST :{X = (int)Math.floor(x)-0.5f;break;}
		case WEST :{X = (int)Math.floor(x)+0.5f;break;}
		}
		wallX = X;
		return X;
	}
	
	public float fixPosZ(float z, POINTTO direction)
	{
		float Z = -1;
		switch(direction)
		{
		case NORTH:{Z = (int)Math.floor(z)+0.5f;break;}
		case SOUTH:{Z = (int)Math.floor(z)-0.5f;break;}
		case EAST :{Z = (int)Math.floor(z);break;}
		case WEST :{Z=  (int)Math.floor(z);break;}
		}
		wallZ = Z;
		return Z;
	}
	
	public float getWallPosX()
	{
		return wallX;
	}
	
	public float getWallPosZ()
	{
		return wallZ;
	}
	
	public void setWallPosX(float x)
	{
		wallX = x;
	}
	
	public void setWallPosZ(float z)
	{
		wallZ = z;
	}
}
